import wsgiref.handlers
from google.appengine.ext import webapp

import handler.main
import handler.admin
import settings


def main():
    application = webapp.WSGIApplication([
        ('/',                            handler.main.Handler),
        (r'/admin(/(\w+)(/(.+))?)?(.*)', handler.admin.Handler),
    ], debug=settings.DEBUG)
    wsgiref.handlers.CGIHandler().run(application)
    
if __name__ == '__main__':
    main()
